<route lang="json5">
{
  style: {
    navigationBarTitleText: '关于',
    // #ifdef MP-ALIPAY
    enablePullDownRefresh: false,
    'mp-alipay': {
      allowsBounceVertical: 'NO',
      transparentTitle: 'always',
      titlePenetrate: 'YES',
      defaultTitle: '',
    },
    // #endif
  },
}
</route>
<template>
  <view class="about-us">
    <view class="header">
      <image class="logo" :src="companyLogo"></image>
      <view class="" style="padding-top: 20rpx">
        <text class="company-name">{{ companyName }}</text>
      </view>
    </view>

    <view class="content">
      <view class="section">
        <view class="section-header">
          <text class="section-title">公司简介</text>
        </view>
        <text class="description">{{ companyDescription }}</text>
      </view>

      <view class="section">
        <view class="section-header">
          <text class="section-title">企业使命</text>
        </view>
        <text class="description">{{ companyMission }}</text>
      </view>

      <view class="section">
        <view class="section-header">
          <text class="section-title">联系我们</text>
        </view>
        <view class="contact-info">
          <view class="contact-item">
            <text class="iconfont icon-location"></text>
            <text>{{ companyAddress }}</text>
          </view>
          <view class="contact-item">
            <text class="iconfont icon-phone"></text>
            <text>{{ companyPhone }}</text>
          </view>
          <view class="contact-item">
            <text class="iconfont icon-email"></text>
            <text>{{ companyEmail }}</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { aboutApi } from '@/service/global'

const companyLogo = ref<string>('')
const companyName = ref<string>('')
const companyDescription = ref<string>('')
const companyMission = ref<string>('')
const companyAddress = ref<string>('')
const companyPhone = ref<string>('')
const companyEmail = ref<string>('')

onLoad(async () => {
  const aboutRes = await aboutApi()
  companyLogo.value = aboutRes.data.companyLogo
  companyName.value = aboutRes.data.companyName
  companyDescription.value = aboutRes.data.companyDescription
  companyMission.value = aboutRes.data.companyMission
  companyAddress.value = aboutRes.data.companyAddress
  companyPhone.value = aboutRes.data.companyPhone
  companyEmail.value = aboutRes.data.companyEmail
})
</script>

<style>
.about-us {
  min-height: 100vh;
  padding: 30px 20px;
  background-color: #f5f5f5;
}

.header {
  padding-bottom: 60rpx;
  text-align: center;
}

.logo {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  border-radius: 20rpx;
}

.company-name {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.content {
  padding: 25px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section {
  margin-bottom: 25px;
}

.section-header {
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.section-title {
  position: relative;
  padding-left: 10px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.section-title::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 18px;
  content: '';
  background-color: #1890ff;
  transform: translateY(-50%);
}

.description {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  text-align: justify;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
}

.contact-item .iconfont {
  margin-right: 10px;
  color: #1890ff;
}
</style>
